package com.ysh.smartplatform.service.impl;

import com.github.pagehelper.PageInfo;
import com.ysh.smartplatform.mapper.OperlogMapper;
import com.ysh.smartplatform.pojo.Operlog;
import com.ysh.smartplatform.service.OperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Jackiechan on 2021/12/26/22:06
 *
 * @author Jackiechan
 * @version 1.0
 * @since 1.0
 */
@Service
@Transactional
public class OperLogServiceImpl implements OperLogService {

    private OperlogMapper operlogMapper;

    @Autowired
    public void setOperlogMapper(OperlogMapper operlogMapper) {
        this.operlogMapper = operlogMapper;
    }

    @Override
    public void addOperLog(Operlog operlog) {
        //此功能为内部aop调用,理论上数据不为空
        operlogMapper.insertSelective(operlog);
    }

    @Override
    public void deleteById(Long operId) {
        operlogMapper.deleteById(operId);
    }

    @Override
    public int updateOper(Operlog operlog) {
        operlogMapper.updateOper(operlog);
        return 0;
    }

    @Override
    public void selectById(Long operId) {
        operlogMapper.selectById(operId);
    }
}
